# -*- coding: utf-8 -*-
# time: 2025/4/17 11:11
# file: video_toText_hf.py
# author: hanson
"""
案例代码：BLIP-2 实现视频转文本

"""


# 安装额外依赖: pip install git+https://github.com/Luodian/Otter.git
"""
from otter.model import OtterVideoModel

model = OtterVideoModel.from_pretrained("luodian/otter-video-800M", device_map="auto")
inputs = model.process_video("test.mp4", prompt="Describe this video:")
output = model.generate(inputs)
"""